package com.gong.DesignPattern.PrototypePattern.shen;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/6/11 0011 9:01
 */
public class Student implements Cloneable{
    String name = "abc";
    int age = 20;
    String address = "绵竹";
    Subject subject = new Subject();

    @Override
    protected Object clone() throws CloneNotSupportedException {

        Student student = (Student) super.clone();
        student.subject = (Subject) this.subject.clone();

        return student;

    }
}
